package com.hbvtc.xxxy.nikeSale.frames;

/*
 * 主界面登录成功之后的跳转界面
 */
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

import com.hbvtc.xxxy.nikeSale.models.Salesman;

public class SuccessSalesmanNike extends JFrame implements ActionListener {
	JButton btnShop, btnEployee, btnMember, btnOrder, btnBack;
	public SuccessSalesmanNike() {
		this.setTitle("Nike销售管理系统注册页面");
		this.setSize(600, 500);
		this.setLocationRelativeTo(null);
		this.setResizable(false);
		this.setVisible(true);

		// 设置标题栏的图标
		ImageIcon imageIcon = new ImageIcon(getClass().getResource("01.png"));
		this.setIconImage(imageIcon.getImage());
		// 背景图片的路径
		String path = "images/09.png";
		ImageIcon background = new ImageIcon(path);
		// 把背景图片显示在一个标签里面
		JLabel label = new JLabel(background);
		// 把标签的大小位置设置为图片刚好填充整个面板
		label.setBounds(0, 0, this.getWidth(), this.getHeight());
		// 把内容窗格转化为JPanel，否则不能用方法setOpaque()来使内容窗格透明
		JPanel imagePanel = (JPanel) this.getContentPane();
		imagePanel.setOpaque(false);
		// 把背景图片添加到分层窗格的最底层作为背景
		this.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE));
		this.setVisible(true);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		this.setLayout(null);

		JLabel lalName = new JLabel();
		this.add(lalName);
		lalName.setBounds(50, 135, 100, 30);
		JLabel lalWelcome = new JLabel();
		this.add(lalWelcome);
		lalWelcome.setBounds(60, 80, 500, 40);
		lalWelcome.setText("欢迎来到Nike销售管理系统");
		lalWelcome.setFont(new Font(null, 0, 40));
		btnShop = new JButton("商品信息");
		btnEployee = new JButton("员工信息");
		btnMember = new JButton("会员信息");
		btnOrder = new JButton("收银界面");
		btnBack = new JButton("返   回");

		this.add(btnShop);
		this.add(btnEployee);
		this.add(btnMember);
		this.add(btnOrder);
		this.add(btnBack);
		btnShop.setBounds(110, 220, 150, 60);
		btnShop.setFont(new Font(null, 0, 20));
		btnEployee.setBounds(320, 220, 150, 60);
		btnEployee.setFont(new Font(null, 0, 20));
		btnMember.setBounds(110, 320, 150, 60);
		btnMember.setFont(new Font(null, 0, 20));
		btnOrder.setBounds(320, 320, 150, 60);
		btnOrder.setFont(new Font(null, 0, 20));
		btnBack.setBounds(470, 400, 110, 40);
		btnBack.setFont(new Font(null, 0, 20));
		btnBack.addActionListener(this);

		btnEployee.addActionListener(this);
		btnMember.addActionListener(this);
		btnOrder.addActionListener(this);
		btnShop.addActionListener(this);
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		if (e.getSource() == btnShop) {
			new ShopNike();
			dispose();
		}
		if (e.getSource() == btnEployee) {
			new SalesmanNike();
		}
		if (e.getSource() == btnMember) {
			new VipNike();
		}
		if (e.getSource() == btnOrder) {
			// 最后的结算页面
			new OverNike();
		}
		if (e.getSource() == btnBack) {
			dispose();
			new MainFramesNike();
		}
	}
}
